import { initMixin } from './init'
import { stateMixin } from './state'
import { renderMixin } from './render'
import { eventsMixin } from './events'
import { lifecycleMixin } from './lifecycle'
import { warn } from '../util/index'

function Vue (options) {
  if (process.env.NODE_ENV !== 'production' &&
    !(this instanceof Vue)
  ) {
    // 说明没有用new 调用
    warn('Vue is a constructor and should be called with the `new` keyword')
  }
  this._init(options)
}


//实例方法
//生成一个_init方法
initMixin(Vue)
//在原型上挂载$data/$props/$watch/$set/$delete
stateMixin(Vue)
//在原型上挂载$on/$once/$off/$emit
eventsMixin(Vue)
//在原型上挂载_update/$forceUpdate/$destroy
lifecycleMixin(Vue)
//在原型上挂载$nextTick/_render
renderMixin(Vue)

export default Vue
